#include "Str.h"
#include "IVisitor.h"

Str::Str(const QString& s, int type, bool unicode, bool raw, bool binary, int nodeId):
    exprType(nodeId),
    _s(s),
    _type(type),
    _unicode(unicode),
    _raw(raw),
    _binary(binary)
{
}
    
Str::~Str()
{
    
}
    
QString Str::type() const
{
    return "Str";
}
    

QString Str::s()
{
    return _s;
}

void Str::setS(const QString& s)
{
    _s = s;
}

int Str::type_()
{
    return _type;
}

void Str::setType_(int type)
{
    _type = type;
}

bool Str::unicode()
{
    return _unicode;
}

void Str::setUnicode(bool unicode)
{
    _unicode = unicode;
}

bool Str::raw()
{
    return _raw;
}

void Str::setRaw(bool raw)
{
    _raw = raw;
}

bool Str::binary()
{
    return _binary;
}

void Str::setBinary(bool binary)
{
    _binary = binary;
}

    
QString Str::toString() const
{
    return QString("Str[s=%1, type=%2, unicode=%3, raw=%4, binary=%5]").
                arg(_s).
                arg(_type).
                arg(_unicode).
                arg(_raw).
                arg(_binary);
}
    
void Str::accept(IVisitor* visitor, const SimpleNodePtr& node)
{
    visitor->visitStr(node.dynamicCast<Str>());
}
    
void Str::traverse(IVisitor* visitor)
{
}